{{#if schemas.length}}
  <div class="row" style="margin-top: 5px; margin-bottom: 5px;">
    <div class="col-xs-12">
      <div
        class="btn-group"
        role="group"
        aria-label="Toggle Table / JSON Schema View">

        <button
          type="button"
          class="btn {{if isTable 'btn-primary' 'btn-default'}}"
          {{action "showView" "table"}}>
          View as Table
        </button>

        <button
          type="button"
          class="btn {{if isTable 'btn-default' 'btn-primary'}}"
          {{action "showView" "json"}}>
          View as JSON
        </button>

      </div>
      <div class="schemas-modified-time" aria-label="Last modified time">
        Last modified: {{lastModified}}
      </div>
    </div>
  </div>

  <table id="json-table" class="columntreegrid tree table table-bordered dataset-detail-table">
    <thead>
      <tr class="results-header">
        <th style="min-width: 200px;" class="col-xs-2">Column</th>
        <th class="col-xs-1">Data Type</th>
        <th style="width:150px;">Default Comments</th>
        <th title="Comment Count" style="width:15px;">
          <i class="fa fa-comments" title="Comment Count"></i>
        </th>
      </tr>
    </thead>
    <tbody>
      {{#each schemas as |schema|}}
        <tr class="{{schema.treeGridClass}}">
          <td>
            <div>

              {{schema.fieldName}}

              {{#if schema.nullable}}
                <span class="schema-property-indicator schema-property-indicator--nullable">
                  N
                  {{tooltip-on-element
                    text="Is Nullable"
                  }}
                </span>
              {{/if}}

              {{#if schema.indexed}}
                <span class="schema-property-indicator schema-property-indicator--indexed">
                  I
                  {{tooltip-on-element
                    text="Is Indexed"
                  }}
                </span>
              {{/if}}

              {{#if schema.partitioned}}
                <span class="schema-property-indicator schema-property-indicator--partitioned">
                  P
                  {{tooltip-on-element
                    text="Is Partitioned"
                  }}
                </span>
              {{/if}}

              {{#if schema.distributed}}
                <span class="schema-property-indicator schema-property-indicator--distributed">
                  D
                  {{tooltip-on-element
                    text="Is Distributed"
                  }}
                </span>
              {{/if}}

            </div>
          </td>

          <td>{{schema.dataType}}</td>

          <td class="commentsArea">
            <div class="commentsArea">
              {{!--{{#schema-comment schema=schema datasetId=dataset.id fieldId=schema.id}}{{/schema-comment}}--}}
              {{schema.commentHtml}}
            </div>
          </td>
          <td class="text-center">
            {{schema.commentCount}}
          </td>
        </tr>
      {{/each}}
    </tbody>
  </table>
  <div id="json-viewer" class="hidden"></div>
{{else}}
  <div id="json-viewer"></div>
{{/if}}
